package menu

import (
	"gitee.com/xgotool/backend-framework-template/model"
	"gitee.com/xgotool/backend-framework-template/service/users"
	"gitee.com/xiaoyutab/xgotool/individual/xginplus"
	"github.com/gin-gonic/gin"
)

// 创建/修改菜单路由
//
//	POST	system/menu/create
func Create(c *xginplus.Context) *xginplus.Response {
	param := model.Menu{}
	err := c.Bind(&param)
	if err != nil {
		return c.Error(err)
	}
	err = users.MenuCreate(&param)
	if err != nil {
		return c.Error(err)
	}
	return c.Success(gin.H{"id": param.Id})
}
